﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace School.WebPages.School
{
    public partial class LeaderList : System.Web.UI.Page
    {
        TechnologySchoolEntities db = new TechnologySchoolEntities();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            var leaders = db.Teachers.Where(t => t.Position == 0).OrderBy(t => t.TOrder);

            dl_leader.DataSource = leaders;
            dl_leader.DataBind();
        }
    }
}
